﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Trippy.Animation;
using Trippy.CollidableGameComponents.Agents;
using Trippy.Abilities;
using Trippy.Levels;

namespace Trippy.CollidableGameComponents.Objects
{
    public class PowerUp : CollidableGameComponent
    {
        public Texture2D SpriteSheet { get; private set; } //different powerups have different psirtes...

        public override void Draw(GameTime gameTime)
        {
            StandardDraw(gameTime);
            base.Draw(gameTime);
        }


        public Ability Ability { get; protected set; }

        public PowerUp(Level level, Ability ability)
            : base (level)
        {
            Ability = ability;
            SpriteSheet = Ability.icon;
            Sprite = new AnimatedSprite(this, SpriteSheet, SpriteSheet.Height, SpriteSheet.Width, 0, 0, 0, 0, 1, 0f);

        }

        protected override void CollisionHandler(CollidableGameComponent component, CollidableGameComponent.CollisionSide side)
        {
            if (component is Hero)
            {
                MarkForDeletion();
            }
            base.CollisionHandler(component, side);
        }

        public override void Update(GameTime gameTime)
        {
            UpdateStandardPhysics(TrippyUtilities.CalculateElapsedTime(gameTime));
            base.Update(gameTime);
        }

    }
}
